package com.model.mapparser;

import java.util.Map;

import com.model.project.Version;


public class ProjectVersionMapParser {

    public static Version fromMap ( Map <String, String[]> map ) {


        boolean errorFound = false;


        String name = null;
        try {
            name = map.get("name")[0];
            if ( name.trim().length() == 0 ) {
                name = null;
            }
        } catch ( ArrayIndexOutOfBoundsException e ) {
        }

        String description = null;
        try {
            description = map.get("description")[0];
            if ( description.trim().length() == 0 ) {
                description = null;
            }
        } catch ( ArrayIndexOutOfBoundsException e ) {
        }

        if ( errorFound ) {
        }


        Version template = null;
        template = new Version();
        template.setName(name);
        template.setDescription(description);

        return template;

    }

}
